<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			html,
			body,
			.container {
				height: 100%;
				width: 100%;
			}
			.one{
				position: relative;
				top: 30%;
				left: 50%;
				transform: translate(-50%,-50%);
				width: 200px;
				height: 200px;
				background-color: rgb(26, 34, 39,0.3);
				
			}
			.ye{
				position: relative;
				top: 50%;
				left: 65%;
				transform: translate(-50%,-50%);
			}
		</style>
	</head>
	<body>
		<div class="container">
			<div class="one">
				<div class="ye">
					<span id="yix"></span>
					<span id="yi" hidden>祝您好运</span>
				<input  name="input1" id="inp1"  />
				<button type="button" name="ks">开始</button>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		let arr=[
			"莫少聪",
    "陆宣容",
    "蒙丹荔",
    "吴添昊",
    "于文霞",
    "彭石源",
    "覃荣君",
    "杨启婷",
    "赵一莲",
    "梁秀梅",
    "李烨健",
    "韦航",
    "蒙贞吉",
    "李宏盛",
    "黄键华",
    "莫瑛玮",
    "罗丽菊",
    "陆柳荣",
    "蓝宏金",
    "黄小燕",
    "卢祖镇",
    "赖俊基",
    "刘家梅",
    "韦忠锦",
    "叶鹏",
    "陈汉华",
    "陈昱伶",
    "覃泉霖",
    "金磊",
    "岑松峻",
    "陈桂民",
    "陈银银",
    "蒙林燕",
    "周刚鸿",
    "姚灿林",
    "杨勇辉",
    "吴晖",
    "陈家有",
    "谢世杰",
    "潘家盛",
    "姜家璇"]
	//点击随机产生随机数，
	//2.获取随机数代替数组序号
	//3.放回input
	$("button[name='ks']").click(function(){
		let yi=45;
		let index=Math.floor(arr.length*Math.random());
		$("input[name='input1']").val(arr[index]);
		$("#yi").show();
		console.log(index);
	})
	</script>
</html>
